Component({
    options: {
        // 添加多slot支持
        multipleSlots: true,
        // 组件样式隔离
        styleIsolation: 'isolated'
    },
    properties: {
        videoData: {
            type: Object,
            value: {}
        }
    },
    data: {
        isPlaying: false
    },
    methods: {
        // 点击播放视频
        onVideoPlay: function () {
            this.setData({ isPlaying: true });
            this.triggerEvent('videoplay', { id: this.properties.videoData.id });
        },

        // 视频暂停事件
        onVideoPause: function () {
            this.setData({ isPlaying: false });
            this.triggerEvent('videopause', { id: this.properties.videoData.id });
        },

        // 点击标签
        onTagTap: function (e) {
            const tag = e.currentTarget.dataset.tag;
            this.triggerEvent('tagtap', { tag });
        }
    }
}) 